package com.uzai.console.dto.app.customlink;


import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.uzai.console.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel("APP自定义链接请求参数")
public class AppCustomLinkDto extends BaseDto {
    @ApiModelProperty("主键id(添加时没有，修改时有)")
    private Long id;

    @ApiModelProperty("活动展示位置(PicWord-轮播图文；MarketNavigate-营销导航；PersonalPicWord-个人中心图文；PersonalGrid-个人中心八宫格；MostOne-优惠头条)")
    private String location;

    @ApiModelProperty("名称")
    private String name;

    @ApiModelProperty("图片地址")
    private String img;

    @ApiModelProperty("链接")
    private String url;

    @ApiModelProperty("链接类型（0-自定义链接；1-站内链接）")
    private Integer type;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLocation() {
        if(StringUtils.isBlank(location)){
            location = "PersonalGrid"; //默认位置为八宫格
        }
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getType() {
        if(type == null){
            type = 0;
        }
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
}
